/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Tema3;

import java.util.Scanner;

/**
 *
 * @author Alex
 */
public class ejer_22_bloque3 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       Scanner teclado = new Scanner (System.in);
      String cad;
      int n;
        System.out.println("Dime un nº: ");
        cad=teclado.nextLine();
        n=Integer.parseInt(cad);
        
        int sumadivisores=0;
        for (int cont = 1; cont <=n/2; cont++) {
            {
                if (n%cont==0)
                {
                    sumadivisores+=cont;
                }
                sumadivisores+=n;
            }
            if (sumadivisores-n==n)
            {
                System.out.println(n+"es perfecto");
            }
            else
            {
                System.out.println(n+"no es perfecto");
            }
        }
    }
}
